USE [vin_brasil]
GO

---------DROP TABLES--------
DROP TABLE dbo.BodyNoReenvio
DROP TABLE dbo.Chassi
DROP TABLE dbo.Parametros
DROP TABLE dbo.SocketHyundai
----------------------------



---------CREATE TABLES----------

/****** Object:  Table [dbo].[BodyNoReenvio]    Script Date: 01/30/2013 11:42:33 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[BodyNoReenvio](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[BodyNo] [nvarchar](50) NULL,
	[Status] [nvarchar](30) NULL,
	[Data] [datetime] NULL
) ON [PRIMARY]

GO


---------------------------------------------------------------------------------------
/****** Object:  Table [dbo].[Chassi]    Script Date: 01/30/2013 11:43:03 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Chassi](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[dataOcorrencia] [datetime] NULL,
	[bodyNumber] [nvarchar](255) NULL,
	[cModule] [nvarchar](255) NULL,
	[dataImpressao] [datetime] NULL,
	[impresso] [int] NULL,
	[reportDate] [datetime] NULL,
	[SEQ] [bigint] NULL,
	[stationCode] [nvarchar](255) NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


------------------------------------------------------------------------------------------------------------------------
/****** Object:  Table [dbo].[Parametros]    Script Date: 01/30/2013 11:43:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Parametros](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[dataOcorrencia] [datetime] NULL,
	[alturaCM] [decimal](19, 5) NULL,
	[espacamentoCM] [decimal](19, 5) NULL,
	[larguraCM] [decimal](19, 5) NULL,
	[loteImpressao] [int] NULL,
	[qtdCopias] [int] NULL,
	[socketPorta] [int] NULL,
	[socketIP] [nvarchar](255) NULL,
	[deviceID] [nvarchar](255) NULL,
	[nomeFonte] [nvarchar](255) NULL,
	[nomeImpressora] [nvarchar](255) NULL,
	[tipoEtiqueta] [nvarchar](255) NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO


------------------------------------------------------------------------------------------------------------------------
/****** Object:  Table [dbo].[SocketHyundai]    Script Date: 01/30/2013 11:45:33 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[SocketHyundai](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[dataOcorrencia] [datetime] NULL,
	[BODY_NO] [nvarchar](255) NULL,
	[chassi] [nvarchar](255) NULL,
	[SN] [nvarchar](255) NULL,
	[SEQ_DIA] [nvarchar](255) NULL,
	[DataChassiSocket] [datetime] NULL,
	[SpoolPoint] [nvarchar](255) NULL,
	[StationCode] [nvarchar](255) NULL,
	[FlagRequisicao] [nvarchar](10) NULL,
PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
-------------------------------------------

  INSERT INTO [vin_brasil].[dbo].[Parametros]
           ([dataOcorrencia]
           ,[alturaCM]
           ,[espacamentoCM]
           ,[larguraCM]
           ,[loteImpressao]
           ,[qtdCopias]
           ,[nomeFonte]
           ,[nomeImpressora]
		  ,[socketIP]
		  ,[socketPorta]
		  ,[deviceID]  
           ,[tipoEtiqueta])
     VALUES
           (GETDATE(), 4, 3.5, 11, 10, 3, 'Glaser Becker Stencil', '\Roland GX-24', '127.0.0.1', 9980, 'DOAP045','R')
GO


